aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/[username]/+layout.server.js
blob: d1b203d73aeacbde1bc77dd60cd7d277beada6c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { get } from '$lib/utils';
import { error } from '@sveltejs/kit';

export let load = async ({ depends, params: { username } }) => {
	depends('app:user');

	try {
		return { subject: await get(`/users/${username}`) };
	} catch (e) {
		console.log(e);
		throw error(500, 'Unable to retrieve user account data');
	}
};